import os
import glob

fileNames = glob.glob("*.py")

lines = classes = defs = 0

for files in fileNames:
    
    if "allicons" in files or "LineCount" in files:
        continue
    
    fid = open(files, "rt")
    while 1:
        tline = fid.readline()
        if not tline:
            fid.close()
            break
        lines += 1
        if tline.startswith("class "):
            classes += 1
        elif tline.startswith("def ") or tline.find(" def ") >= 0:
            defs += 1

print "[%d, %d, %d, %d]"%(len(fileNames)-2, classes, defs, lines)
